<html>
<body>
<p>The following is a guide for using the new server in Pokemon Essentials (as of September 1, 2008), as
used in the online trade system. For those interested, the <a href="protocol.txt">protocol document</a> 
details the protocol used.</p>

<p>The very small server, 32 KB, was written in C# using the .NET Framework 2.0.  It uses the Microsoft Access
database driver that is included in the .NET Framework.  To begin, copy the files in Server.zip to an empty folder
and open netserver.xml (in Notepad) to configure the details of the server used to listen for connections:</p>
<ul>
<li>The <b>hostname</b> (IP) can either be a subdomain, an IP address, or the special value "localhost", which
stands for the local computer.  Using a subdomain allows you to hide the IP address of your server, since
the subdomain is less likely than the IP address to change.</li>
<li>The <b>port</b> (port) can be any number from 1 through 65535; the number 4000 appears to be a fine 
choice.</li>
</ul>
<p>Enter the hostname and port and save the file.  Then run netserver.exe and you're all finished. (It should 
say that the server is using the specified IP address and port.)  The source code to the server is included 
in Source.zip.</p>

<h3>Publishing the Server</h3>

<p>There are two ways to make the server available for others for use.  The easier way is to use a program called
"Hamachi".</p>

<ol>
<li>Download <a href="http://www.download.com/LogMeIn-Hamachi/3000-2651_4-10785910.html?tag=lst-1">"Hamachi"</a>
and install it.  You should choose the "Basic" configuration during the installation process.</li>
<li>After installing Hamachi, run it and follow the instructions until you create a Hamachi network.  Then, use
the IP address found at the top of the Hamachi window in the netserver.xml file.</li>
<li>If necessary, you should disable any firewalls you have.</li>
</ol>

<p>There is also a more difficult way to publish the server, which is detailed here.</p>

<ol>
<li>Create an account on <a href="http://www.dyndns.com/">DynDNS.com</a>.  After doing so, <a href="https://www.dyndns.com/account/services/hosts/add.html">log in</a>,
choose a hostname (subdomain), choose "Use auto detected IP address" in the IP address section, and finally choose "Create Host".
Use the hostname generated in this step in the netserver.xml file.</li>
<li>Choose a port from 1 through 65535, such as 4000.  Use <a href="http://www.portforward.com/english/routers/port_forwarding/routerindex.htm">this page</a>
to find your router, and follow the instructions to forward the selected port to allow its use by outsiders.  (You can also
forward other ports in the same way, such as the HTTP port 80.)  If you don't have a router, skip this step.  If your
router is not listed, please contact your Internet Service Provider.</li>
<li>If necessary, you should disable any firewalls you have.</li>
</ol>

<p>Finally, add an entry to "servers.txt" containing the hostname and port determined in the preceding steps.
An example of such a line is: "xxx.xxx.net:4000" or "111.222.33.44:4000".</p>

</body>
</html>